package fat
{

import com.fit4as.fit.*;


    /** A fixture that processes other Fit documents. */
public class ReferenceFixture extends ColumnFixture
{
    public var Description : String;
    public var Location : String;
    public var Note : String;

    public function Result() : String {
        var inputFileName : String = "spec/input/" + Location;
        var outputFileName : String = "spec/output/" + Location;
        try {
            var runner : FileRunner = new FileRunner();
            runner.args([inputFileName, outputFileName]);
            runner.process();
            runner.output.close();

            var counts : Counts = runner.fixture.counts;
            if ((counts.exceptions == 0) && (counts.wrong == 0)) {
                return "pass";
            }

            return "fail: " + counts.right + " right, " + counts.wrong + " wrong, " + counts.exceptions + " exceptions";
        }
        catch (err : Error) {
            return "error: " + err;
        }
    }
}
}